package com.sicaolong.partterndesign._02strategy._01;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Cat implements MyComparable {
    private String name;
    private int age;

    @Override
    public int compareTo(Object o) {
        Cat c = (Cat) o;
        return Integer.compare(age, c.age);
    }
}
